home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / prof < prev    next >
Internet Message Format  |  1995-03-31  |  7KB

  1. From: Henrik Johansson <Henrik.Johansson@nexus.comm.se>
  2. Subject:  v03i020:  prof - A game for practicing arithmetic v1.0, Part01/01
  3. Newsgroups: comp.sources.hp48
  4. Organization: NEXUS Communications AB, Uppsala, Sweden
  5. Followup-To: comp.sys.hp48
  6. Approved: spell@seq.uncwil.edu
  7.  
  8. Checksum: 2639735496 (verify with brik -cv)
  9. Submitted-by: Henrik Johansson <Henrik.Johansson@nexus.comm.se>
  10. Posting-number: Volume 3, Issue 20
  11. Archive-name: prof/part01
  12.  
  13. BEGIN_DOC prof.doc
  14.  
  15.         PROF - a game for practising arithmetic
  16.  
  17.   The longer I use a calculator, the more I feel the need do practise
  18. arithmetic in the head.  Therefore I wrote this program to make it a
  19. little more easy and fun.  It's a little big, but that's because it
  20. got out of hand and I implemented different levels of complexity too.
  21.   Unfortunately the number input routine has some left to wish for, so
  22. please don't enter anything but a number or just empty input.
  23.   The name comes from a small dedicated handheld called "little
  24. professor" I saw once that does approximately the same thing.
  25.  
  26. To play: download either this program or the "ASC" version that
  27. follows.  Store it under a "good" name and run it.  Chose between `+',
  28. `-',. `*' or `/'.  Then chose level 1 (easy), 2 (medium) or 3 (hard).
  29. The question apperas on the screen, and it is up to you to compute the
  30. answer in the head and enter it.  If you just press <ENTER> the game
  31. will end.
  32.  
  33. It is easy to cheat...if you are asked "28*29=" and don't want to
  34. admit to your calculator that you don't know it then enter
  35. "28 29 * <ENTER>" and the calc will think you did the right thing!
  36. END_DOC
  37.  
  38.  
  39. BEGIN_RPL prof.rpl
  40. %%HP: T(3)A(R)F(.);
  41. \<<
  42.   \<< \-> lst msg
  43.     \<< CLLCD -1
  44.       WHILE lst
  45. SWAP POS DUP NOT
  46.       REPEAT DROP
  47. msg 2 DISP 0 WAIT
  48.       END
  49.     \>>
  50.   \>> \-> choice
  51.   \<< { 95.1 85.1
  52. 75.1 65.1 }
  53. "Choose one of:
  54.     +  -  *  /"
  55. choice EVAL { 82.1
  56. 83.1 84.1 }
  57. "Level 1, 2 or 3:"
  58. choice EVAL { { +
  59.     \<< DUP2 +
  60.     \>> { { 0 40 } {
  61. 5 100 } { 5 200 } }
  62. } { -
  63.     \<<
  64.       IF DUP2 <
  65.       THEN SWAP
  66.       END DUP2 -
  67.     \>> { { 0 40 } {
  68. 5 100 } { 5 200 } }
  69. } { *
  70.     \<< DUP2 *
  71.     \>> { { 0 10 } {
  72. 5 20 } { 8 30 } } }
  73. { /
  74.     \<< DUP2 * 3
  75. ROLLD
  76.     \>> { { 1 10 } {
  77. 2 20 } { 2 30 } } }
  78. } ROT GET OBJ\-> DROP
  79. 4 ROLL GET EVAL \->
  80. op fnc low high
  81.     \<<
  82.       WHILE 1
  83.       REPEAT RAND
  84. high low - * low +
  85. IP RAND high low -
  86. * low + IP fnc EVAL
  87. \-> a b res
  88.         \<< "
  89.     " a
  90. + op + b + "=" + ""
  91. INPUT
  92.           IF DUP ""
  93. ==
  94.           THEN DROP
  95. 0 DOERR
  96.           END OBJ\->
  97.           IF res \=/
  98.           THEN
  99. CLLCD
  100. " WRONG!
  101.  Right answer: "
  102. res + 3 DISP 1.5
  103. WAIT
  104.           ELSE
  105. CLLCD "!" 3 DISP
  106.           END
  107.         \>>
  108.       END
  109.     \>>
  110.   \>>
  111. \>>
  112. END_RPL
  113.  
  114. ----------
  115. The same, but in "ASC" format:
  116.  
  117. BEGIN_ASC prof.asc
  118. %%HP: T(3)A(R)F(.);
  119. "D9D20E1632C9432D9D20E16321C432D6E2030C63747D6E2030D63776E1632858
  120. A1683A233032D6E2030C63747DBBF14BAC178BF1F88E1D5032D9D208DBF1D6E2
  121. 030D63776ED2A2485A14B2A2F17A1B213049632EF53293632B21301C432D6E20
  122. 603686F6963656E163247A203392010000000000015903392010000000000015
  123. 80339201000000000001570339201000000000001560B2130C2A20F30003486F
  124. 6F6375602F6E65602F666A3A002020202B20202D20202A20202F2D6E20603686
  125. F6963656EB3A147A203392010000000000012803392010000000000013803392
  126. 01000000000001480B2130C2A2052000C4566756C60213C2022302F6270233A3
  127. D6E20603686F6963656EB3A147A2047A2076BA1D9D20E16322ABF176BA193632
  128. B213047A2047A204B2A2339201000000000000040B213047A20D13A233920200
  129. 0000000000010B213047A20D13A2339202000000000000020B2130B2130B2130
  130. 47A2090DA1D9D20E16323CE222ABF1EBBE1AFE22DBBF15DF222ABF190DA19363
  131. 2B213047A2047A204B2A2339201000000000000040B213047A20D13A23392020
  132. 00000000000010B213047A20D13A2339202000000000000020B2130B2130B213
  133. 047A20EEDA1D9D20E16322ABF1EEDA193632B213047A2047A204B2A233920100
  134. 0000000000010B213047A20D13A2339201000000000000020B213047A20C53A2
  135. 339201000000000000030B2130B2130B213047A2050FA1D9D20E16322ABF1EED
  136. A13F2A20DCF193632B213047A2047A209C2A2339201000000000000010B21304
  137. 7A20ED2A2339201000000000000020B213047A20ED2A23392010000000000000
  138. 30B2130B2130B2130B2130E0CF16C7D1B7FC18DBF1803A25BCF16C7D1EB3A11C
  139. 432D6E2020F607D6E203066E636D6E2030C6F677D6E204086967686E16323303
  140. 29C2A2D5032D9D209B1C1D6E204086967686D6E2030C6F67790DA1EEDA1D6E20
  141. 30C6F67776BA1D6BB19B1C1D6E204086967686D6E2030C6F67790DA1EEDA1D6E
  142. 2030C6F67776BA1D6BB1D6E203066E636EB3A11C432D6E201016D6E201026D6E
  143. 2030275637E1632C2A20F0000A002020202D6E20101676BA1D6E2020F60776BA
  144. 1D6E20102676BA1C2A2070000D376BA1C2A2050000AC4223CE2278BF1C2A2050
  145. 000279E1AFE22D9D208DBF14B2A2933A1B21305DF22B7FC13CE22D6E20302756
  146. 37D9AE1AFE22D9D20858A1C2A2033000027525F4E47412A00225967686470216
  147. E637775627A302D6E203027563776BA13F2A2485A1339200000000000000510F
  148. 17A1B21305BF22D9D20858A1C2A2070000123F2A2485A1B21305DF22EF532B21
  149. 3049632EF532EF53293632B21304255"
  150. END_ASC
  151.  
  152.  
  153. BYTES: #5524h 982
  154.  
  155. BEGIN_UU prof.uue
  156. begin 644 prof
  157. M2%!(4#0X+46=+>!A(YPTTMD"'C823"-M+C#`-D?7Y@(#;7-G'C:"A1J&HS(#;
  158. M(VTN,,`V1]>['[3*<;@?C^C1!2.=+8"]'VTN,-`V=^8M*H2E02LJ'Z>Q$@.4D
  159. M-N)?(SDVLA(#P332Y@(&8VAO:6-E'C9"IP(S*1```````!"5,),"`0``````>
  160. M40@S*1```````!!U,),"`0``````408K,<"B`C\`,(3V]C97!O+F5@;R9J:C>
  161. M``("`K("`M("`J("`O+2Y@(&8VAO:6-EOJ-!IP(S*1```````!"",),"`0``K
  162. M````,0@S*1```````!"$L!(#+"I0`@!,979E;"`Q+"`R(&]R(#,Z;2Y@,(;VP
  163. MEC96YCL:="I`IP)GJ]'9`AXV(KH?9ZN18R,K,4"G`G0J0"LJ,RD0````````1
  164. M0+`2`W0JT#$J,RD@````````$+`2`W0JT#$J,RD@````````(+`2`RLQL!(#J
  165. M="J0T!J=+>!A(\,N(KH?ONNA[R*]^U'](J+[D=`:.3:R$@-T*D"G`K2B,I,"-
  166. M`0````````0K,4"G`AVC,I,"`@````````$K,4"G`AVC,I,"`@````````(KY
  167. M,;`2`RLQ0*<"[JW1V0(>-B*Z'^ZMD6,C*S%`IP)T*D`K*C,I$````````!"PK
  168. M$@-T*M`Q*C,I$````````""P$@-T*L`U*C,I$````````#"P$@,K,;`2`W0J7
  169. M4/`:G2W@82.B^^'>&O.B`LT?.3:R$@-T*D"G`LFB,I,"`0````````$K,4"G4
  170. M`MZB,I,"`0````````(K,4"G`MZB,I,"`0````````,K,;`2`RLQL!(##OQAO
  171. M?!U[SX&]'PBC4LL?QM?A.QK!--+F`@)O<&TN,&#F-M;F`@-L;W=M+D"`EG:&]
  172. MYF$C,S"2+"I=,-+9`KG!T>8"!&AI9VAM+C#`]G:7T!KNK='F`@-L;W=GJ]&VQ
  173. M&[G!T>8"!&AI9VAM+C#`]G:7T!KNK='F`@-L;W=GJ]&V&VTN,&#F-N8[&L$TO
  174. MTN8"`6%M+A`@UN8"`W)E<QXVPJ("#P"@``("`M+F`@%A9ZO1Y@(";W!GJ]'F8
  175. M`@%B9ZO!H@('`-!SMAHL*E```,HD,NPBA_O!H@(%`""7'OHNTMD"V/M!*RHYZ
  176. MH[$2`]4OLO<<PR[2Y@(#<F5SG>JA[R*=+8"%&BPJ,`,`(%=23TY'(0H@4FEGZ
  177. M:'0@86YS=V5R.B!M+C`@5S9WMAKSHD)8&C,I`````````!7P<1HK,5#[(ITMY
  178. E@(4:+"IP```A\Z)"6!HK,5#](OXULA(#E#;B7R/^-9)C(RLQ`"LQH
  179. ``
  180. end
  181. END_UU
  182.  
  183. --
  184. Henrik.Johansson@Nexus.Comm.SE        Henrik Johansson
  185.                     Communicator Nexus AB
  186.                     Box 857
  187.                     S - 751 08 Uppsala  SWEDEN
  188.  
  189.